import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/config'
import '@/assets/style/index.less'
import './utils/dialog'
import VueLazyload from 'vue-lazyload'
import print from 'print-js'
// 引入rem
import '@/utils/flexible.js'
import 'echarts/lib/component/tooltip'
Vue.config.productionTip = false
import 'video.js/dist/video-js.css'
import videojs from 'video.js';
import 'videojs-contrib-hls'
import Video from 'video.js'
import 'video.js/dist/video-js.css'
Vue.prototype.$video = Video;
import Vue2OrgTree from 'vue-tree-color'
Vue.use(Vue2OrgTree)
Vue.use(VueLazyload)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

Vue.directive('loadmore', {
  bind (el, binding) {
    const selectWrap = el.querySelector('.el-table__body-wrapper')
    selectWrap.addEventListener('scroll', function () {
      let sign = 0
      const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
      if (scrollDistance <= sign) {
        binding.value()
      }
    })
  }
})
